<?php

namespace app\common\model;

use think\Model;
use traits\model\SoftDelete;

/**
 * @brief   消息
 * @author wanchengniuniu
 * @date 2025/2/27
 *
 * @param
 * @return
 */
class ContractError extends Model
{
    use SoftDelete;
    // 表名
    protected $name = 'user_contract_error';
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'integer';
    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';
    protected $deleteTime = 'deletetime';

    const STATUS_NORMAL=1;//已修
    const STATUS_DEFAULT=0;//未修

    const TYPE_ONE=1;//水
    const TYPE_TWO=2;//电
    const TYPE_THREE=3;//天然气
    const TYPE_FORE=4;//家电

    static public function getTypeList($type=2,$value=1)
    {
        $data= [
            self::TYPE_ONE=>'水',
            self::TYPE_TWO=>'电',
            self::TYPE_THREE=>'天然气',
            self::TYPE_FORE=>'家电',
        ];
        if($type==1){
            return isset($data[$value])?$data[$value]:'';
        }else{
            return $data;
        }
    }


    static public function getStatusList($type=2,$value=1)
    {
        $data= [
            self::STATUS_NORMAL=>'已修',
            self::STATUS_DEFAULT=>'未修',
        ];
        if($type==1){
            return isset($data[$value])?$data[$value]:'';
        }else{
            return $data;
        }
    }



}
